package com.example.week07.controller;

import com.example.week07.dao.model.User;
import com.example.week07.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户接口
 *
 * @author 西柚
 * @date 2021-09-13 14:03:36
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/user")
@Api(value = "/user", tags = "用户接口")
public class UserController {

    @Autowired
    private IUserService userService;

    @ApiOperation("添加")
    @PostMapping("/add")
    public void add(@RequestBody User bo) {
        userService.add(bo);
    }

}
